using System;
using System.Collections.Generic;
using UnityEngine;

namespace ZSW.Framework
{
    [Serializable]
    public class CursorTex
    {
        public string Name;
        public Texture2D Texture;
    }

    public class ZSWF_CursorManager : ZSWF_Singleton<ZSWF_CursorManager>
    {
        public List<CursorTex> CursorTexes;

        public void SetCursor(string name)
        {
            var cursorTex = CursorTexes.Find(x => x.Name == name);
            if (cursorTex != null)
            {
                Cursor.SetCursor(cursorTex.Texture, Vector2.zero, CursorMode.Auto);
            }
            else
            {
                Debug.LogWarning($"鼠标光标样式设置失败, 未找到名为{name}的光标样式");
            }
        }
    }
}